﻿#include "connection.h"

connection::connection()
{
	db = QSqlDatabase::addDatabase("QSQLITE");		// MySQL数据库
	db.setDatabaseName("radb-lab.db");		//这里输入你的数据库名
	if (!db.open()) {
		isOpen = false;
		QMessageBox::critical(0, QObject::tr("open database failed!"), "cannot connect to database!", QMessageBox::Cancel);
	}
	else {
		isOpen = true;
	}
}
